package cn.ml.web1662.commons;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils {
    public static Date strConvertDate(String date, String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        try {
            return  sdf.parse(date);
        } catch (ParseException e) {
            throw new RuntimeException("自定义异常",e);
        }
    }
}
